<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'scrapCheck.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
div{
	width:980px;
	height:800px;
	
}
table{

border-top:1px solid gray;
border-left:1px solid gray;
}
tr{

}
td{
margin:0px;
width:80px;
text-align:center;
border-right:1px solid gray;
border-bottom:1px solid gray;
}
.name{
width:300px;
}

</style>
  </head>
  
  <body>
<div>
 <table>
 <thead>
 <tr>
 <td>报损单号</td>
 <td>书籍编号</td>
 <td class="name">书籍名称</td>
 <td>报损人</td>
 <td>报损数量</td>
 <td>报损时间</td>
 <td>报损详情</td>
 <c:if test="${requestScope.level==1 }">
  <td>操作</td>
 </c:if>
  <c:if test="${requestScope.level==2 }">
  <td>状态</td>
 </c:if>
 </tr>
 </thead>
 <tbody>

<c:forEach items="${requestScope.list}" var="list">
 <tr>
 <td>${list. s_id}</td>
  <td>${list. b_id}</td>
  <td class="name">${list. b_name}</td>
   <td>${list. s_p_user}</td>
   <td>${list. s_num}</td>
    <td>${list. s_p_time}</td>
     <td>${list. s_detail}</td>
     <c:if test="${requestScope.level=='1' }">
     	<c:if test="${ list.s_state=='0'}">
     	<td><a href="jsp/scrap/ScrapState?state=1&sid=${list. s_id}">同意</a> <a href="scrap/ScrapState?state=2&sid=${list. s_id}&snum=${list. s_num}&bid=${list. b_id}">拒绝</a></td>
     	</c:if>
     	<c:if test="${list.s_state=='1'}">
     		<td>已同意</td>
     	</c:if>
     	<c:if test="${list.s_state=='2'}">
     		<td>已拒绝</td>
     	</c:if>
     </c:if>
     <c:if test="${requestScope.level==2 }">
     	<c:if test="${list.s_state=='0'}">
     		<td>待审批</td>
    	 </c:if>
     	<c:if test="${list.s_state=='1'}">
     		<td>已同意</td>
     	</c:if>
     	<c:if test="${list.s_state=='2'}">
     		<td>已拒绝</td>
     	</c:if>
     </c:if>
   </tr>    
</c:forEach>

 

 </tbody>
 </table>
 </div>
  </body>
</html>
